# -*- coding:utf8 -*-
import json
from analysis.parse import dbutils



class BraData():
    def __init__(self,d):
        self.__dict__ = d


#s = '{"name": "ACME", "shares": 50, "price": 490.1}'
jsonfile = open("./bra.json","r+",encoding="utf8").read()

dbdata = dbutils.get_jsondata_by_id(2)
print(dbdata)
data = json.loads(dbdata,object_hook=BraData)
print(type(data.comments))

print(data.productCommentSummary.skuId)     # itemid
print(data.comments[0].productSize)         # 罩杯
print(data.comments[0].userProvince)        # 地区
print(data.comments[0].content)             # 评论
print(data.comments[0].productColor)        # 胸罩颜色
print(data.comments[0].userClientShow)      # 客户端显示
print(data.comments[0].isMobile)            # 是否是手机




# print data.comments[2].content
# print data.comments[3].content
# print data.comments[4].content
# print data.comments[5].content
# print data.comments[6].content


